package com.zhou.cloud.service;

import com.zhou.cloud.dao.entity.Product;

import java.util.List;

/**
 * @descrition: 商品逻辑服务
 * @author: zhouyongjun
 * @date: 2022/11/22
 **/
public interface IProductService {
    /**
    * @Description: 获取所有商品
    * @Params:
    * @Returns:
    * @Author: zhouyongjun
    * @Date Created in 2022/11/22 15:41
     */
    List<Product> getAllList();

    /**
    * @Description: 获取可售出处理列表
    * @Params:
    * @Returns:
    * @Author: zhouyongjun
    * @Date Created in 2022/11/22 15:42
     */
    List<Product> getCanSoldList();

    /**
    * @Description: 获取卖完商品数量
    * @Params: 
    * @Returns: 
    * @Author: zhouyongjun
    * @Date Created in 2022/11/22 15:43
     */
    List<Product> getSoldOutList();

    /**
    * @Description: 获取指定ID商品
    * @Params:
    * @Returns:
    * @Author: zhouyongjun
    * @Date Created in 2022/11/22 15:41
     */
    Product get(Long id);
    /**
    * @Description: 卖出商品数量
    * @Params:
    * @Returns:
    * @Author: zhouyongjun
    * @Date Created in 2022/11/22 15:41
     */
    boolean sold(Long id, int num);

    boolean soldFromCache(Long pid, Integer delNum);
}
